package com.hedd.shop.controller;

import com.hedd.shop.pojo.entity.ProductType;
import com.hedd.shop.pojo.vo.RespResult;
import com.hedd.shop.service.ProductTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ludi
 * @date:2020/8/29 15:32
 * @description:商品种类业务控制层
 */
@Controller
@RestController
@RequestMapping("/productType")
@Api(tags = "商品种类业务接口")
public class ProductTypeController extends BaseController {

    @Autowired
    private ProductTypeService productTypeService;

    @PostMapping("/showAllProductType")
    @ApiOperation("展示所有商品种类")
    public RespResult showAllProductType(){
        List<ProductType> list = productTypeService.selectAllProductType();
        return returnRespWithSuccess(list);
    }
}
